﻿using Castle.DynamicProxy;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PLCS.Client.IService.Attributes
{
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class LogAttribute : BaseAOPAttribute
    {
        public string MethodName { get; set; }

        public LogAttribute(string methodName)
        {
            MethodName = methodName;
        }

        public override Action<IInvocation> AOPAction(IInvocation invocation, Action<IInvocation> action)
        {
            return (invocation) =>
            {
                action.Invoke(invocation);
            };
        }
    }

    public class LogBeforeAttribute : Attribute
    {
        public string MethodName { get; set; }
    }

    public class LogAfterAttribute : Attribute
    { }
}